package com.stx.design.composite;

import java.util.ArrayList;
import java.util.List;

public abstract class STFile {
	
	protected String name;
	protected List<STFile> childs = new ArrayList<STFile>();
	
	public STFile(String name){
		this.name = name;
	}
	
	public void add(STFile file){
		childs.add(file);
	}
	
	public void remove(STFile file){
		childs.remove(file);
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public String getName(){
		return this.name;
	}
	
	public void display(){
		System.out.println(getName());
		for(STFile f : childs){
			f.display();
		}
	}
	public abstract void browse();		
	
}
